#ifndef SQLIST_H
#define SQLIST_H

#include "List.h"

#define LIST_INIT_SIZE 10
#define LIST_INCREMENT 2

class SqList: public List {

public:
    SqList() {};
    ~SqList();

public:
    virtual Status InitList(void) override;
    virtual Status DestoryList(void)override;
    virtual Status ClearList(void)override;
    virtual Status ListEmpty(void)override;
    virtual int ListLength(void)override;
    virtual Status GetElem(int i, ElemType *e)override;
    virtual int LocateElem(ElemType e, Status(*compare)(ElemType, ElemType))override;
    virtual Status PriorElem(ElemType cur, ElemType *prev)override;
    virtual Status NextElem(ElemType cur, ElemType *next)override;
    virtual Status ListInsert(int i, ElemType e)override;
    virtual Status ListDelete(int i, ElemType *e)override;
    virtual Status ListTraverse(void) override;
    /**
     * 合并两个线性表
     * 将i线性表Lb中不在La中的数据元素插入到La中
     */
    virtual Status ListMerge(List *Lb)override;

private:
    ElemType *elem;
    int length;
    int listsize;
};

#endif